#pragma once

#include "OCMain/Environment.h"
#include "json/json.h"
#include "OCServer/ServerTimer.h"


using namespace OCPP;

const StringVector Parameters = {
	"Temperature_surface",
	"u_v-component_of_wind_height_above_ground",
	"u_v-component_of_wind_isobaric",
};

const StringVector Levels = {
	"0",
	"10m",
};


class GFSFetcher : public ServerTimer,public CSingleton<GFSFetcher>
{
public:
	void doJob();
	static String getVarName(String param, String level);

	String getFile(String t,String v,String l);
	
	void setNumHourData(int value)
	{
		_numHourData = value;
	}
private:
	bool downloadGrib(Date date,int skipHour);
	Date lastDataDate;
	int _numHourData;
};

